package com.aspose.cells.a.c;

import com.aspose.cells.zasq;
import java.io.InputStream;

public class zw {
   public static void a(com.aspose.cells.b.a.d.zm var0, com.aspose.cells.b.a.d.zm var1) {
      try {
         if (var0 == null) {
            throw new IllegalArgumentException("srcStream");
         } else if (var1 == null) {
            throw new IllegalArgumentException("dstStream");
         } else {
            byte[] var2 = new byte[4096];

            while(true) {
               int var3 = var0.a(var2, 0, var2.length);
               if (var3 <= 0) {
                  return;
               }

               var1.b(var2, 0, var3);
            }
         }
      } catch (Exception var4) {
         throw zasq.a(18, "Failed to copy stream", var4);
      }
   }

   public static byte[] a(com.aspose.cells.b.a.d.zm var0, boolean var1) {
      try {
         Object var2 = null;
         byte[] var5;
         if (var0.k()) {
            var0.b(0L);
            var5 = new byte[(int)var0.h()];
            var0.a(var5, 0, (int)var0.h());
         } else {
            com.aspose.cells.b.a.d.zh var3 = new com.aspose.cells.b.a.d.zh();
            a(var0, var3);
            var5 = var3.o();
         }

         if (var1) {
            var0.a();
         }

         return var5;
      } catch (Exception var4) {
         throw zasq.a(18, "Failed to read data from stream", var4);
      }
   }

   public static com.aspose.cells.b.a.d.zh a(InputStream var0) {
      try {
         return new com.aspose.cells.b.a.d.zh(var0);
      } catch (Exception var2) {
         throw zasq.a(18, "Failed to read data from InputStream", var2);
      }
   }
}
